package org.zheng.shop.dto;

import org.zheng.shop.entity.ConsultationMessage;

import java.time.LocalDateTime;

/**
 * 咨询消息DTO
 */
public class ConsultationMessageDTO {
    private Long id;
    private Long sessionId;
    private Integer senderId;
    private String senderName;
    private String content;
    private String senderType;
    private LocalDateTime sentAt;

    public ConsultationMessageDTO() {}

    public ConsultationMessageDTO(ConsultationMessage message) {
        this.id = message.getId();
        this.sessionId = message.getSessionId();
        this.senderId = message.getSenderId();
        this.senderName = message.getSenderName();
        this.content = message.getContent();
        this.senderType = message.getSenderType().name();
        this.sentAt = message.getSentAt();
    }

    // Getters and Setters
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getSessionId() {
        return sessionId;
    }

    public void setSessionId(Long sessionId) {
        this.sessionId = sessionId;
    }

    public Integer getSenderId() {
        return senderId;
    }

    public void setSenderId(Integer senderId) {
        this.senderId = senderId;
    }

    public String getSenderName() {
        return senderName;
    }

    public void setSenderName(String senderName) {
        this.senderName = senderName;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getSenderType() {
        return senderType;
    }

    public void setSenderType(String senderType) {
        this.senderType = senderType;
    }

    public LocalDateTime getSentAt() {
        return sentAt;
    }

    public void setSentAt(LocalDateTime sentAt) {
        this.sentAt = sentAt;
    }
}
